import { IsStringRw } from '@/common/utils/class-validator';
import { Transform } from 'class-transformer';
import { IsNumber, IsOptional } from 'class-validator';

export class CreateDictDataDto {
  @IsStringRw()
  label: string;

  @IsStringRw()
  value: string;

  @Transform(({ value }) => Number(value) || 1)
  @IsNumber()
  status?: number;

  @Transform(({ value }) => Number(value) || 1)
  @IsNumber()
  sort?: number;

  @IsStringRw()
  @IsOptional()
  tagType: string; // ""

  @IsStringRw()
  @IsOptional()
  dictCode: string;
}
